package com.dhcc.sds.base.service.impl;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.dhcc.core.framework.result.node.ZTreeNode;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.plugins.Page;
import com.dhcc.core.framework.base.service.impl.BaseServiceImpl;
import com.dhcc.sds.base.dao.SdsQcfitemDicMapper;
import com.dhcc.sds.base.service.ISdsQcfitemDicService;
import com.dhcc.sds.base.entity.SdsQcfitemDicEntity;
import org.springframework.util.CollectionUtils;

/**
 * 表单值域字典表表数据服务层接口
 * 
 * @ClassName: SdsQcfitemDicServiceImpl
 * @Description: TODO
 * @author sunyingjie
 * @date 2021-03-22 10:10:47
 */
@Service("sdsQcfitemDicService")
public class SdsQcfitemDicServiceImpl extends BaseServiceImpl<SdsQcfitemDicMapper, SdsQcfitemDicEntity> implements ISdsQcfitemDicService {

	@Override
	public List<SdsQcfitemDicEntity> page(Page<SdsQcfitemDicEntity> page, Map<String, Object> map) {
		return this.baseMapper.page(page, map);
	}
	@Override
	public List<SdsQcfitemDicEntity> list(Map<String, Object> map) {
		return this.baseMapper.list(map);
	}
	@Override
	public List<ZTreeNode> getItemDicTree(Long formItemId) {
		List<ZTreeNode> tree = this.baseMapper.treeByItemId(formItemId);
		tree.add(ZTreeNode.createRoot("值域字典"));
		return tree;
	}
	@Override
	public List<SdsQcfitemDicEntity> listByItemId(Long formItemId) {
		return this.baseMapper.listByItemId(formItemId);
	}

	@Override
	public String getDicDesc(Long formItemId, String code) {
		return this.baseMapper.selectDicDesc(formItemId, code);
	}
}